package model

import "github.com/zeromicro/go-zero/core/stores/sqlx"

var _ CustomerEntityModel = (*customCustomerEntityModel)(nil)

type (
	// CustomerEntityModel is an interface to be customized, add more methods here,
	// and implement the added methods in customCustomerEntityModel.
	CustomerEntityModel interface {
		customerEntityModel
		withSession(session sqlx.Session) CustomerEntityModel
	}

	customCustomerEntityModel struct {
		*defaultCustomerEntityModel
	}
)

// NewCustomerEntityModel returns a model for the database table.
func NewCustomerEntityModel(conn sqlx.SqlConn) CustomerEntityModel {
	return &customCustomerEntityModel{
		defaultCustomerEntityModel: newCustomerEntityModel(conn),
	}
}

func (m *customCustomerEntityModel) withSession(session sqlx.Session) CustomerEntityModel {
	return NewCustomerEntityModel(sqlx.NewSqlConnFromSession(session))
}
